package org.zfes.snowier.cloud.zbss.metting.router.service.user;

import java.util.Map;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.metting.biz.dto.SigninCreateDto;
import org.zfes.snowier.cloud.zbss.metting.biz.model.Signin;
import org.zfes.snowier.cloud.zbss.metting.biz.service.ISigninService;
@Controller("org.zfes.snowier.cloud.zbss.metting.router.service.user.SigninController") 
@RequestMapping("/met/service/user/signin")
public class SigninController extends BaseController {

	
	@Autowired
	private ISigninService signinService;
	
    @RequestMapping(value="/loadSigninDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadSigninDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  signinService.loadSigninDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
    @RequestMapping(value="/createSignin", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createSignin(SigninCreateDto signinCreateDto){
		signinService.createSignin(signinCreateDto);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
    @RequestMapping(value="/loadSignin", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadSignin(Long id){
		Optional<Signin> ops = signinService.loadSigninById(id);
		return ajaxQuery("signin",ops);
    }
	
	

}